package com.first.agent.dao.impl;

import com.first.agent.dao.FinanceTypeDao;
import com.first.agent.dbutils.JdbcBuild;

import java.sql.SQLException;

public class FinanceTypeDaoImpl extends JdbcBuild implements FinanceTypeDao {
    @Override
    public int financeTypeAdd(String finance_type, Integer fi_state) throws SQLException {//财务类型增加的实现代码
        String sql="insert into finance_type (finance_type,fi_state) value (?,?)";
        Object[] params={finance_type,fi_state};
        return super.executeUpdate(sql,params);
    }

    @Override
    public int financeTypeMod(String finance_type, Integer fi_state,String oldFinance_type) throws SQLException {//财务类型修改的实现代码
        String sql="update finance_type set finance_type=?,fi_state=? where finance_type=?";
        Object[] params={finance_type,fi_state,oldFinance_type};
        return super.executeUpdate(sql,params);
    }

    @Override
    public int financeTypeDel(String finance_type) throws SQLException {//财务类型删除的实现代码
        String sql="delete from finance_type where finance_type=?";
        Object[] params={finance_type};
        return super.executeUpdate(sql,params);
    }
}
